package org.csmzxy.class2334;

import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个三位数");
        int number = scanner.nextInt();
        if (number < 100 || number > 999) {
            System.out.println("该数不是一个三位数，请重新输入");
            return;
        }
        int originalNumber = number;
        int sum = 0;
        while (number > 0) {
            int digit = number % 10;
            sum += digit * digit * digit;
            number /= 10;
        }
        if (sum == originalNumber){
            System.out.println(originalNumber+"是水仙花数");
        }else {
            System.out.println(originalNumber+"不是水仙花数");
        }
        scanner.close();
    }
}